<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateTableContentMenu extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('content_menu', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->integer('parent_id', false, true)->default(0)->comment('父级ID');
            $table->string('name', 255)->nullable(false)->comment('栏目名');
            $table->integer('sort_number', false, true)->default(0)->comment('排序，越大越前');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('content_menu');
    }
}
